Support coalesce/min/max operations on all formulas#8
Merged
Conversation
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
And make it internal. There will be a new `Formula` trait that implements additional formula operations that will depend on `FormulaSubscriber`. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
This just exposes the same methods from the component graph's Formula trait, but with metric comparison and retaining the ability to subscribe to them. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
92a2c76 to
1c4e664
Compare
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
coalesce/min/max operations on all formulas
There was a problem hiding this comment.
Pull Request Overview
This PR extends the formula system to support coalesce, min, and max operations on all formula types, replacing a hard-coded component-specific coalesce method with a generic trait-based approach.
- Introduces a generic
Formulatrait with coalesce/min/max operations that works with all formula types - Refactors the formula system using trait-based design with
GraphFormulaProviderandFormulaSubscribertraits - Adds a new
componentmethod to access metrics for individual components by ID
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/logical_meter/logical_meter_handle.rs | Removes hard-coded coalesce method, adds generic component method, updates documentation |
| src/logical_meter/formula/graph_formula_provider.rs | Refactors macro system to support component ID parameter and updates trait implementations |
| src/logical_meter/formula/coalesce_formula.rs | Implements new trait system with conversion methods for FormulaParams |
| src/logical_meter/formula/aggregation_formula.rs | Implements new trait system and updates arithmetic operations to use FormulaParams |
| src/logical_meter/formula.rs | Introduces new trait system with generic Formula trait supporting coalesce/min/max operations |
| examples/logical_meter.rs | Updates example to demonstrate new coalesce functionality and improves logging configuration |
| Cargo.toml | Updates component graph and formula engine dependencies to newer revisions |
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Because we are exposing it publicly now, it doesn't have to be hidden away in a separate module anymore. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
niklas-timpe
approved these changes
Aug 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.